import axios from 'axios';
import router from '../router'
import {Message} from 'element-ui';
import db from '@/utils/localstorage'
import NProgress from 'nprogress' // 进度条

let BASE_ADMIN_DEV = 'http://localhost:9000/api/';
let BASE_ADMIN_TEST = 'https://scrmt.chengsijin.com/api/';
let BASE_ADMIN_PRO = 'https://scrm.chengsijin.com/api/';

const ADMIN_SYSTEM = "ADMIN";


// =====================登录系统==========================
// 登录
export const login = data => {
    return ADMIN_POST('system/login', null, data)
};
// 获取菜单数据
export const getMenuData = params => {
    return ADMIN_GET('admin/ding/getMenuList', params, null)
};
// 得到上传图片的接口地址
export const getUploadUrl = () => {
    return getBase(ADMIN_SYSTEM) + "h5/uploadFile";
};
// 获取下拉列表框内容
export const getOptions = enumClass => {
    return ADMIN_GET('admin/common/options', {'enumClass': enumClass}, null)
};
// 获取参数值
export const getParamValue = paramKey => {
    return ADMIN_GET('admin/common/param/value', {'paramKey': paramKey}, null)
};
// 获取最近N周的起始日期
export const getLastNWeek = n => {
    return ADMIN_GET('admin/common/getLastNWeek', {'n': n}, null)
};
// 获取最近N月的起始日期
export const getLastNMonth = n => {
    return ADMIN_GET('admin/common/getLastNMonth', {'n': n}, null)
};


// =====================权限管理==========================
export const getPermissionByPage = data => {
    return ADMIN_POST('admin/permission/page', null, data)
};
export const addPermission = data => {
    return ADMIN_POST('admin/permission/add', null, data)
};
export const updatePermission = data => {
    return ADMIN_POST('admin/permission/update', null, data)
};
export const deletePermission = params => {
    return ADMIN_POST('admin/permission/deleteById', params, null)
};
export const shufflePermission = params => {
    return ADMIN_GET('admin/permission/shuffle', params, null)
};


// =====================定时任务管理==========================
export const getScheduleJobByPage = data => {
    return ADMIN_POST('admin/schedule/job/page', null, data)
};
export const addScheduleJob = data => {
    return ADMIN_POST('admin/schedule/job/add', null, data)
};
export const updateScheduleJob = data => {
    return ADMIN_POST('admin/schedule/job/update', null, data)
};
export const deleteScheduleJob = params => {
    return ADMIN_POST('admin/schedule/job/deleteById', params, null)
};
export const pauseScheduleJob = params => {
    return ADMIN_POST('admin/schedule/job/pause', params, null)
};
export const startScheduleJob = params => {
    return ADMIN_POST('admin/schedule/job/start', params, null)
};
export const executeNowScheduleJob = params => {
    return ADMIN_POST('admin/schedule/job/executeNow', params, null)
};
export const executeWithParamsScheduleJob = (params, data) => {
    return ADMIN_POST('admin/schedule/job/executeWithParams', params, data)
};
export const scheduleMetaData = params => {
    return ADMIN_GET('admin/schedule/job/metaData', null, null)
};
export const getScheduleInnerJobs = params => {
    return ADMIN_GET('admin/schedule/job/innerJobs', null, null)
};


// =====================系统参数管理==========================
export const getParamsConfigByPage = data => {
    return ADMIN_POST('admin/params/config/page', null, data)
};
export const addParamsConfig = data => {
    return ADMIN_POST('admin/params/config/add', null, data)
};
export const updateParamsConfig = data => {
    return ADMIN_POST('admin/params/config/update', null, data)
};
export const deleteParamsConfig = params => {
    return ADMIN_POST('admin/params/config/deleteById', params, null)
};


// =====================公众号模版消息配置==========================
export const getMpTemplateMessageConfigByPage = data => {
    return ADMIN_POST('admin/mpTemplateMessageConfig/page', null, data)
};
export const addMpTemplateMessageConfig = data => {
    return ADMIN_POST('admin/mpTemplateMessageConfig/add', null, data)
};
export const updateMpTemplateMessageConfig = data => {
    return ADMIN_POST('admin/mpTemplateMessageConfig/update', null, data)
};
export const deleteMpTemplateMessageConfig = params => {
    return ADMIN_POST('admin/mpTemplateMessageConfig/deleteById', params, null)
};


// =====================顾客管理==========================
export const getCustomerByPage = data => {
    return ADMIN_POST('admin/customer/page', null, data)
};
export const addCustomer = data => {
    return ADMIN_POST('admin/customer/add', null, data)
};
export const updateCustomer = data => {
    return ADMIN_POST('admin/customer/update', null, data)
};
export const deleteCustomer = params => {
    return ADMIN_POST('admin/customer/deleteById', params, null)
};
export const selectCustomerByMobileNo = params => {
    return ADMIN_GET('admin/customer/selectByMobileNo', params, null)
};
export const selectCustomerById = params => {
    return ADMIN_GET('admin/customer/selectById', params, null)
};


// =====================顾客操作日志==========================
export const getCustomerTimelineByPage = data => {
    return ADMIN_POST('admin/customer/timeline/page', null, data)
};
export const addCustomerTimeline = data => {
    return ADMIN_POST('admin/customer/timeline/add', null, data)
};
export const updateCustomerTimeline = data => {
    return ADMIN_POST('admin/customer/timeline/update', null, data)
};
export const deleteCustomerTimeline = params => {
    return ADMIN_POST('admin/customer/timeline/deleteById', params, null)
};


// =====================预定管理==========================
export const getReserveByPage = data => {
    return ADMIN_POST('admin/reserve/page', null, data)
};
export const addReserve = data => {
    return ADMIN_POST('admin/reserve/add', null, data)
};
export const updateReserve = data => {
    return ADMIN_POST('admin/reserve/update', null, data)
};
export const deleteReserve = params => {
    return ADMIN_POST('admin/reserve/deleteById', params, null)
};
export const getReserveDownloadUrl = () => {
    return getBase(ADMIN_SYSTEM) + "admin/reserve/downloadTemplate";
}
export const getReserveUploadUrl = () => {
    return getBase(ADMIN_SYSTEM) + "admin/reserve/upload";
}

// =====================预定通知模版管理==========================
export const getReserveNoticeTemplateByPage = data => {
    return ADMIN_POST('admin/reserve/notice/template/page', null, data)
};
export const addReserveNoticeTemplate = data => {
    return ADMIN_POST('admin/reserve/notice/template/add', null, data)
};
export const updateReserveNoticeTemplate = data => {
    return ADMIN_POST('admin/reserve/notice/template/update', null, data)
};
export const deleteReserveNoticeTemplate = params => {
    return ADMIN_POST('admin/reserve/notice/template/deleteById', params, null)
};


// =====================预定发送记录==========================
export const getReserveNoticeByPage = data => {
    return ADMIN_POST('admin/reserve/notice/page', null, data)
};
export const addReserveNotice = data => {
    return ADMIN_POST('admin/reserve/notice/add', null, data)
};
export const updateReserveNotice = data => {
    return ADMIN_POST('admin/reserve/notice/update', null, data)
};
export const deleteReserveNotice = params => {
    return ADMIN_POST('admin/reserve/notice/deleteById', params, null)
};
// 饼图+柱状图数据
export const getReserveNoticeChartData = params => {
    return ADMIN_GET('admin/reserve/notice/getChartData', params, null)
};


// =====================预定规则配置==========================
export const getReserveRuleByPage = data => {
    return ADMIN_POST('admin/reserve/rule/page', null, data)
};
export const addReserveRule = data => {
    return ADMIN_POST('admin/reserve/rule/add', null, data)
};
export const updateReserveRule = data => {
    return ADMIN_POST('admin/reserve/rule/update', null, data)
};
export const deleteReserveRule = params => {
    return ADMIN_POST('admin/reserve/rule/deleteById', params, null)
};


// =====================预定相册管理==========================
export const getReserveAlbumByPage = data => {
    return ADMIN_POST('admin/reserve/album/page', null, data)
};
export const addReserveAlbum = data => {
    return ADMIN_POST('admin/reserve/album/add', null, data)
};
export const updateReserveAlbum = data => {
    return ADMIN_POST('admin/reserve/album/update', null, data)
};
export const deleteReserveAlbum = params => {
    return ADMIN_POST('admin/reserve/album/deleteById', params, null)
};


// =====================用户管理==========================
export const getUserByPage = data => {
    return ADMIN_POST('admin/user/page', null, data)
};
export const addUser = data => {
    return ADMIN_POST('admin/user/add', null, data)
};
export const updateUser = data => {
    return ADMIN_POST('admin/user/update', null, data)
};
export const deleteUser = params => {
    return ADMIN_POST('admin/user/deleteById', params, null)
};
export const loginOutUser = params => {
    return ADMIN_POST('admin/user/loginOut', params, null)
};
export const getLoginUserInfo = params => {
    return ADMIN_GET('admin/user/getLoginUserInfo', params, null)
};


// ===================用户登录日志==========================
export const getUserLoginLogByPage = data => {
    return ADMIN_POST('admin/user/login/log/page', null, data)
};
export const addUserLoginLog = data => {
    return ADMIN_POST('admin/user/login/log/add', null, data)
};
export const updateUserLoginLog = data => {
    return ADMIN_POST('admin/user/login/log/update', null, data)
};
export const deleteUserLoginLog = params => {
    return ADMIN_POST('admin/user/login/log/deleteById', params, null)
};


// =====================门店管理==========================
export const getShopByPage = data => {
    return ADMIN_POST('admin/shop/page', null, data)
};
export const addShop = data => {
    return ADMIN_POST('admin/shop/add', null, data)
};
export const updateShop = data => {
    return ADMIN_POST('admin/shop/update', null, data)
};
export const deleteShop = params => {
    return ADMIN_POST('admin/shop/deleteById', params, null)
};
export const getShopById = params => {
    return ADMIN_GET('admin/shop/selectById', params, null)
};
export const updateShopSwitch = data => {
    return ADMIN_POST('admin/shop/updateSwitch', null, data)
};
export const setShopFields = data => {
    return ADMIN_POST('admin/shop/setFields', null, data)
};


// =====================门店员工管理========================
export const getShopEmployeeByPage = data => {
    return ADMIN_POST('admin/shop/employee/page', null, data)
};
export const addShopEmployee = data => {
    return ADMIN_POST('admin/shop/employee/add', null, data)
};
export const updateShopEmployee = data => {
    return ADMIN_POST('admin/shop/employee/update', null, data)
};
export const deleteShopEmployee = params => {
    return ADMIN_POST('admin/shop/employee/deleteById', params, null)
};


// =====================门店桌台区域管理========================
export const getShopTableAreaByPage = data => {
    return ADMIN_POST('admin/shop/table/area/page', null, data)
};
export const addShopTableArea = data => {
    return ADMIN_POST('admin/shop/table/area/add', null, data)
};
export const updateShopTableArea = data => {
    return ADMIN_POST('admin/shop/table/area/update', null, data)
};
export const deleteShopTableArea = params => {
    return ADMIN_POST('admin/shop/table/area/deleteById', params, null)
};


// =====================门店桌台管理========================
export const getShopTableByPage = data => {
    return ADMIN_POST('admin/shop/table/page', null, data)
};
export const addShopTable = data => {
    return ADMIN_POST('admin/shop/table/add', null, data)
};
export const updateShopTable = data => {
    return ADMIN_POST('admin/shop/table/update', null, data)
};
export const deleteShopTable = params => {
    return ADMIN_POST('admin/shop/table/deleteById', params, null)
};


// =====================商户信息==========================
export const getMerchantByPage = data => {
    return ADMIN_POST('admin/merchant/page', null, data)
};
export const getMerchantByPageAll = data => {
    return ADMIN_POST('admin/merchant/pageAll', null, data)
};
export const addMerchant = data => {
    return ADMIN_POST('admin/merchant/add', null, data)
};
export const updateMerchant = data => {
    return ADMIN_POST('admin/merchant/update', null, data)
};
export const deleteMerchant = params => {
    return ADMIN_POST('admin/merchant/deleteById', params, null)
};
export const addMerchantUser = data => {
    return ADMIN_POST('admin/merchant/addUser', null, data)
};


// =====================MP账号管理==========================
export const getMpInfoByPage = data => {
    return ADMIN_POST('admin/mpInfo/page', null, data)
};
export const addMpInfo = data => {
    return ADMIN_POST('admin/mpInfo/add', null, data)
};
export const updateMpInfo = data => {
    return ADMIN_POST('admin/mpInfo/update', null, data)
};
export const deleteMpInfo = params => {
    return ADMIN_POST('admin/mpInfo/deleteById', params, null)
};
export const refreshMpInfo = params => {
    return ADMIN_POST('admin/mpInfo/refresh', params, null)
};
export const getMpInfoById = params => {
    return ADMIN_GET('admin/mpInfo/selectById', params, null)
};
export const createOpenAccountById = params => {
    return ADMIN_GET('admin/mpInfo/createOpenAccount', params, null)
};
// 授权添加
export const addMpInfoByAuth = params => {
    return ADMIN_GET('wx/open/getAuthUrlEx', params, null)
};
// 从公众号快速注册小程序
export const fastRegisterMnpEx = params => {
    return ADMIN_GET('wx/open/fastRegisterMnpEx', params, null)
};


// =====================公众号详情页面========================
// 获取公众号详情
export const getMpDetailByMpId = params => {
    return ADMIN_GET('admin/mp/detail/selectByMpId', params, null)
};
// 获取公众号关联的小程序
export const getMpLinkMnpList = params => {
    return ADMIN_GET('admin/mp/detail/getLinkMnpList', params, null)
};
// 公众号关联小程序
export const linkMnp = data => {
    return ADMIN_POST('admin/mp/detail/linkMnp', null, data)
};
// 公众号解除小程序
export const unLinkMnp = data => {
    return ADMIN_POST('admin/mp/detail/unLinkMnp', null, data)
};
// 设置默认行业
export const setMpDefaultIndustry = params => {
    return ADMIN_POST('admin/mp/detail/setDefaultIndustry', params, null)
};
// 设置模版消息
export const setMpTemplateMessage = params => {
    return ADMIN_POST('admin/mpTemplateMessage/setTemplateMessage', params, null)
};
// 设置字段
export const setMpFields = data => {
    return ADMIN_POST('admin/mpInfo/setFields', null, data)
};


// =====================小程序详情页面========================
// 修改小程序名称
export const modifyMnpName = data => {
    return ADMIN_POST('admin/mpInfo/modifyName', null, data)
};
// 修改小程序介绍
export const modifyMnpSignature = data => {
    return ADMIN_POST('admin/mpInfo/modifySignature', null, data)
};
// 修改小程序头像
export const modifyMnpAvatar = data => {
    return ADMIN_POST('admin/mpInfo/modifyAvatar', null, data)
};
// 获取小程序详情
export const getMnpDetailByMpId = params => {
    return ADMIN_GET('admin/mnp/detail/selectByMpId', params, null)
};
// 切换访问状态
export const switchMnpVisitStatus = params => {
    return ADMIN_GET('admin/mnp/detail/switchVisitStatus', params, null)
};
// 切换搜索状态
export const switchMnpSearchStatus = params => {
    return ADMIN_GET('admin/mnp/detail/switchSearchStatus', params, null)
};
// 设置小程序域名
export const setMnpDomain = data => {
    return ADMIN_POST('admin/mnp/detail/setDomain', null, data)
};
// 快速设置小程序域名
export const quickSetMnpDomain = params => {
    return ADMIN_POST('admin/mnp/detail/quickSetDomain', params, null)
};
// 获取类目信息
export const getMnpSettingCategories = params => {
    return ADMIN_GET('admin/mnp/detail/getSettingCategories', params, null)
};
// 设置默认类目
export const setMnpDefaultCategory = params => {
    return ADMIN_POST('admin/mnp/detail/setDefaultCategory', params, null)
};
// 设置类目
export const setMnpCategory = data => {
    return ADMIN_POST('admin/mnp/detail/setCategory', null, data)
};
// 获取位置权限
export const getMnpLocationPrivacy = params => {
    return ADMIN_GET('admin/mnp/detail/getLocationPrivacy', params, null)
};
// 申请位置权限
export const applyMnpLocationPrivacy = data => {
    return ADMIN_POST('admin/mnp/detail/applyLocationPrivacy', null, data)
};
// 获取小程序设置信息
export const getMnpSettingByMpId = params => {
    return ADMIN_GET('admin/mnp/setting/selectByMpId', params, null)
};
// 更新小程序设置信息
export const updateMnpSettingInfo = data => {
    return ADMIN_POST('admin/mnp/setting/updateSetting', null, data)
};
// 增加小程序体验者
export const addMnpTrialUser = params => {
    return ADMIN_POST('admin/mnp/detail/addTrialUser', params, null)
};
// 移除小程序体验者
export const removeMnpTrialUser = params => {
    return ADMIN_POST('admin/mnp/detail/removeTrialUser', params, null)
};
// 获取订阅消息模版
export const getMnpSubscribeTemplates = params => {
    return ADMIN_GET('admin/mnp/detail/getSubscribeTemplateList', params, null)
};
// 同步订阅消息模版
export const syncMnpSubscribeTemplates = params => {
    return ADMIN_POST('admin/mnp/detail/syncSubscribeTemplateList', params, null)
};
// 设置订阅消息模版
export const setMnpSubscribeTemplates = params => {
    return ADMIN_POST('admin/mnp/detail/setSubscribeTemplateList', params, null)
};
// 删除订阅消息模版
export const deleteMnpSubscribeTemplate = params => {
    return ADMIN_POST('admin/mnp/detail/deleteSubscribeTemplate', params, null)
};
// 获取插件信息
export const getMnpPlugins = params => {
    return ADMIN_GET('admin/mnp/detail/getPlugins', params, null)
};
// 解绑插件
export const unbindMnpPlugins = params => {
    return ADMIN_POST('admin/mnp/detail/unbindPlugin', params, null)
};
// 绑定插件
export const bindMnpPlugins = params => {
    return ADMIN_POST('admin/mnp/detail/bindPlugin', params, null)
};


// =====================小程序版本管理==========================
export const getMnpVersionByPage = data => {
    return ADMIN_POST('admin/mnp/version/page', null, data)
};
export const addMnpVersion = data => {
    return ADMIN_POST('admin/mnp/version/add', null, data)
};
export const updateMnpVersion = data => {
    return ADMIN_POST('admin/mnp/version/update', null, data)
};
export const deleteMnpVersion = params => {
    return ADMIN_POST('admin/mnp/version/deleteById', params, null)
};
// 发布体验版
export const commitMnpTrial = data => {
    return ADMIN_POST('admin/mnp/version/commitTrial', null, data)
};
// 获取体验版本二维码
export const getMnpTrialCode = params => {
    return ADMIN_GET('admin/mnp/version/getTrialCode', params, null)
};
// 设置隐私保护
export const settingMnpPrivacy = params => {
    return ADMIN_GET('admin/mnp/version/settingPrivacy', params, null)
};
// 提交审核
export const submitMnpAudit = data => {
    return ADMIN_POST('admin/mnp/version/submitAudit', null, data)
};
// 查询审核状态
export const queryMnpAuditStatus = params => {
    return ADMIN_GET('admin/mnp/version/queryAuditStatus', params, null)
};
// 发布小程序
export const releaseMnp = params => {
    return ADMIN_POST('admin/mnp/version/release', params, null)
};
// 撤回审核
export const revokeMnpAudit = params => {
    return ADMIN_POST('admin/mnp/version/revokeAudit', params, null)
};
// 查询审核额度
export const getAuditQuota = params => {
    return ADMIN_GET('admin/mnp/version/getAuditQuota', params, null)
};
// 加急审核
export const speedUpMnpAudit = params => {
    return ADMIN_POST('admin/mnp/version/speedAudit', params, null)
};
// 切换自动发布状态
export const switchMnpAutoRelease = params => {
    return ADMIN_POST('admin/mnp/version/switchAutoRelease', params, null)
};


// =====================公众号关注用户管理==========================
export const getMpSubscriberByPage = data => {
    return ADMIN_POST('admin/mpSubscriber/page', null, data)
};
export const addMpSubscriber = data => {
    return ADMIN_POST('admin/mpSubscriber/add', null, data)
};
export const updateMpSubscriber = data => {
    return ADMIN_POST('admin/mpSubscriber/update', null, data)
};
export const deleteMpSubscriber = params => {
    return ADMIN_POST('admin/mpSubscriber/deleteById', params, null)
};
export const refreshSubscriberInfo = params => {
    return ADMIN_POST('admin/mpSubscriber/refresh', params, null)
};
export const refreshAllSubscriberInfo = params => {
    return ADMIN_POST('admin/mpSubscriber/refreshAll', params, null)
};


// =====================公众号日志管理==========================
export const getMpLogByPage = data => {
    return ADMIN_POST('admin/mpLog/page', null, data)
};
export const addMpLog = data => {
    return ADMIN_POST('admin/mpLog/add', null, data)
};
export const updateMpLog = data => {
    return ADMIN_POST('admin/mpLog/update', null, data)
};
export const deleteMpLog = params => {
    return ADMIN_POST('admin/mpLog/deleteById', params, null)
};


// =====================公众号模版消息==========================
export const getMpTemplateMessageByPage = data => {
    return ADMIN_POST('admin/mpTemplateMessage/page', null, data)
};
export const addMpTemplateMessage = data => {
    return ADMIN_POST('admin/mpTemplateMessage/add', null, data)
};
export const updateMpTemplateMessage = data => {
    return ADMIN_POST('admin/mpTemplateMessage/update', null, data)
};
export const deleteMpTemplateMessage = params => {
    return ADMIN_POST('admin/mpTemplateMessage/deleteById', params, null)
};
export const syncMpTemplateMessage = params => {
    return ADMIN_POST('admin/mpTemplateMessage/sync', params, null)
};


// =====================公众号素材管理==========================
export const getMpMaterialByPage = data => {
    return ADMIN_POST('admin/mpMaterial/page', null, data)
};
export const addMpMaterial = data => {
    return ADMIN_POST('admin/mpMaterial/add', null, data)
};
export const updateMpMaterial = data => {
    return ADMIN_POST('admin/mpMaterial/update', null, data)
};
export const deleteMpMaterial = params => {
    return ADMIN_POST('admin/mpMaterial/deleteById', params, null)
};
export const getMpMaterialById = params => {
    return ADMIN_GET('admin/mpMaterial/selectById', params, null)
};


// =====================公众号消息回复==========================
export const getMpMessageReplyByPage = data => {
    return ADMIN_POST('admin/mpMessageReply/page', null, data)
};
export const addMpMessageReply = data => {
    return ADMIN_POST('admin/mpMessageReply/add', null, data)
};
export const updateMpMessageReply = data => {
    return ADMIN_POST('admin/mpMessageReply/update', null, data)
};
export const deleteMpMessageReply = params => {
    return ADMIN_POST('admin/mpMessageReply/deleteById', params, null)
};


// =====================公众号二维码管理==========================
export const getMpQrcodeByPage = data => {
    return ADMIN_POST('admin/mpQrcode/page', null, data)
};
export const addMpQrcode = data => {
    return ADMIN_POST('admin/mpQrcode/add', null, data)
};
export const updateMpQrcode = data => {
    return ADMIN_POST('admin/mpQrcode/update', null, data)
};
export const deleteMpQrcode = params => {
    return ADMIN_POST('admin/mpQrcode/deleteById', params, null)
};
export const setMpQrcodeReplyMaterial = params => {
    return ADMIN_POST('admin/mpQrcode/setReplyMaterial', params, null)
};
export const delMpQrcodeReplyMaterial = params => {
    return ADMIN_POST('admin/mpQrcode/delReplyMaterial', params, null)
};


// =====================开放平台账号管理========================
export const getOpenAccountByPage = data => {
    return ADMIN_POST('admin/openAccount/page', null, data)
};
export const addOpenAccount = data => {
    return ADMIN_POST('admin/openAccount/add', null, data)
};
export const updateOpenAccount = data => {
    return ADMIN_POST('admin/openAccount/update', null, data)
};
export const deleteOpenAccount = params => {
    return ADMIN_POST('admin/openAccount/deleteById', params, null)
};
// 绑定开放平台
export const bindOpenAccount = data => {
    return ADMIN_POST('admin/openAccount/bind', null, data)
};
// 解除绑定开放平台
export const unbindOpenAccount = data => {
    return ADMIN_POST('admin/openAccount/unbind', null, data)
};
// 查看绑定关系
export const getOpenAccountBindByPage = data => {
    return ADMIN_POST('admin/openAccountBind/page', null, data)
};


// =====================微信支付账号管理========================
export const getWxPayByPage = data => {
    return ADMIN_POST('admin/wxPay/page', null, data)
};
export const addWxPay = data => {
    return ADMIN_POST('admin/wxPay/add', null, data)
};
export const updateWxPay = data => {
    return ADMIN_POST('admin/wxPay/update', null, data)
};
export const deleteWxPay = params => {
    return ADMIN_POST('admin/wxPay/deleteById', params, null)
};
// 绑定微信支付
export const bindWxPay = data => {
    return ADMIN_POST('admin/wxPay/bind', null, data)
};
// 解除绑定微信支付
export const unbindWxPay = data => {
    return ADMIN_POST('admin/wxPay/unbind', null, data)
};
// 查看绑定关系
export const getWxPayBindByPage = data => {
    return ADMIN_POST('admin/wxPayBind/page', null, data)
};


// =====================会员卡管理==========================
export const getMemberCardByPage = data => {
    return ADMIN_POST('admin/memberCard/page', null, data)
};
export const addMemberCard = data => {
    return ADMIN_POST('admin/memberCard/add', null, data)
};
export const updateMemberCard = data => {
    return ADMIN_POST('admin/memberCard/update', null, data)
};
export const deleteMemberCard = params => {
    return ADMIN_POST('admin/memberCard/deleteById', params, null)
};
export const getMemberCardById = params => {
    return ADMIN_GET('admin/memberCard/selectById', params, null)
};
export const getMemberCardShopsById = params => {
    return ADMIN_GET('admin/memberCard/selectMemberCardShopsById', params, null)
};
export const memberCardLinkShop = data => {
    return ADMIN_POST('admin/memberCard/memberCardLinkShop', null, data)
};
export const memberCardUnLinkShop = data => {
    return ADMIN_POST('admin/memberCard/memberCardUnLinkShop', null, data)
};
export const getMemberCardMpsById = params => {
    return ADMIN_GET('admin/memberCard/selectMemberCardMpsById', params, null)
};
export const memberCardLinkMp = data => {
    return ADMIN_POST('admin/memberCard/memberCardLinkMp', null, data)
};
export const memberCardUnLinkMp = data => {
    return ADMIN_POST('admin/memberCard/memberCardUnLinkMp', null, data)
};


// =====================会员卡活动管理=========================
export const getMemberCardActivityByPage = data => {
    return ADMIN_POST('admin/memberCard/activity/page', null, data)
};
export const addMemberCardActivity = data => {
    return ADMIN_POST('admin/memberCard/activity/add', null, data)
};
export const updateMemberCardActivity = data => {
    return ADMIN_POST('admin/memberCard/activity/update', null, data)
};
export const deleteMemberCardActivity = params => {
    return ADMIN_POST('admin/memberCard/activity/deleteById', params, null)
};


// =====================会员卡等级管理=========================
export const getMemberCardLevelByPage = data => {
    return ADMIN_POST('admin/memberCard/level/page', null, data)
};
export const addMemberCardLevel = data => {
    return ADMIN_POST('admin/memberCard/level/add', null, data)
};
export const updateMemberCardLevel = data => {
    return ADMIN_POST('admin/memberCard/level/update', null, data)
};
export const deleteMemberCardLevel = params => {
    return ADMIN_POST('admin/memberCard/level/deleteById', params, null)
};


// =====================会员卡充值规则管理=========================
export const getMemberCardRechargeRuleByPage = data => {
    return ADMIN_POST('admin/memberCard/recharge/rule/page', null, data)
};
export const addMemberCardRechargeRule = data => {
    return ADMIN_POST('admin/memberCard/recharge/rule/add', null, data)
};
export const updateMemberCardRechargeRule = data => {
    return ADMIN_POST('admin/memberCard/recharge/rule/update', null, data)
};
export const deleteMemberCardRechargeRule = params => {
    return ADMIN_POST('admin/memberCard/recharge/rule/deleteById', params, null)
};


// =====================会员管理==========================
export const getMemberByPage = data => {
    return ADMIN_POST('admin/member/page', null, data)
};
export const addMember = data => {
    return ADMIN_POST('admin/member/add', null, data)
};
export const updateMember = data => {
    return ADMIN_POST('admin/member/update', null, data)
};
export const deleteMember = params => {
    return ADMIN_POST('admin/member/deleteById', params, null)
};
export const getMemberById = params => {
    return ADMIN_GET('admin/member/selectById', params, null)
};
export const adjustMemberBalance = data => {
    return ADMIN_POST('admin/member/adjustBalance', null, data)
};
export const adjustMemberPoints = data => {
    return ADMIN_POST('admin/member/adjustPoints', null, data)
};
// 会员消费
export const memberConsume = data => {
    return ADMIN_POST('admin/member/consume', null, data)
};
// 获取优惠券
export const getMemberCoupons = params => {
    return ADMIN_GET('admin/member/myCoupons', params, null)
};
// 发放优惠券
export const giveMemberCoupon = data => {
    return ADMIN_POST('admin/member/giveCoupon', null, data)
};
// 根据ID验证优惠券
export const verifyCouponById = params => {
    return ADMIN_POST('admin/member/verifyCouponById', params, null)
};
// 根据券码验证优惠券
export const verifyCouponByCode = params => {
    return ADMIN_POST('admin/member/verifyCouponByCode', params, null)
};
// 设置管理员
export const setAdmin = params => {
    return ADMIN_POST('admin/member/setAdmin', params, null)
};


// =====================会员余额管理==========================
export const getBalanceTransactionByPage = data => {
    return ADMIN_POST('admin/balance/transaction/page', null, data)
};
export const addBalanceTransaction = data => {
    return ADMIN_POST('admin/balance/transaction/add', null, data)
};
export const updateBalanceTransaction = data => {
    return ADMIN_POST('admin/balance/transaction/update', null, data)
};
export const deleteBalanceTransaction = params => {
    return ADMIN_POST('admin/balance/transaction/deleteById', params, null)
};


// =====================会员积分管理==========================
export const getPointsTransactionByPage = data => {
    return ADMIN_POST('admin/points/transaction/page', null, data)
};
export const addPointsTransaction = data => {
    return ADMIN_POST('admin/points/transaction/add', null, data)
};
export const updatePointsTransaction = data => {
    return ADMIN_POST('admin/points/transaction/update', null, data)
};
export const deletePointsTransaction = params => {
    return ADMIN_POST('admin/points/transaction/deleteById', params, null)
};


// =====================优惠券管理==========================
export const getCouponByPage = data => {
    return ADMIN_POST('admin/coupon/page', null, data)
};
export const addCoupon = data => {
    return ADMIN_POST('admin/coupon/add', null, data)
};
export const updateCoupon = data => {
    return ADMIN_POST('admin/coupon/update', null, data)
};
export const deleteCoupon = params => {
    return ADMIN_POST('admin/coupon/deleteById', params, null)
};
export const getCouponById = params => {
    return ADMIN_GET('admin/coupon/selectById', params, null)
};
export const getCouponShopsById = params => {
    return ADMIN_GET('admin/coupon/selectCouponShopsById', params, null)
};
export const couponLinkShop = data => {
    return ADMIN_POST('admin/coupon/couponLinkShop', null, data)
};
export const couponUnLinkShop = data => {
    return ADMIN_POST('admin/coupon/couponUnLinkShop', null, data)
};


// ======================优惠券营销===========================
export const getCouponMarketingByPage = data => {
    return ADMIN_POST('admin/coupon/marketing/page', null, data)
};
export const addCouponMarketing = data => {
    return ADMIN_POST('admin/coupon/marketing/add', null, data)
};
export const updateCouponMarketing = data => {
    return ADMIN_POST('admin/coupon/marketing/update', null, data)
};
export const deleteCouponMarketing = params => {
    return ADMIN_POST('admin/coupon/marketing/deleteById', params, null)
};
export const getCouponMarketingById = params => {
    return ADMIN_GET('admin/coupon/marketing/selectById', params, null)
};


// ======================优惠券营销记录=========================
export const getCouponMarketingRecordByPage = data => {
    return ADMIN_POST('admin/coupon/marketing/record/page', null, data)
};
export const addCouponMarketingRecord = data => {
    return ADMIN_POST('admin/coupon/marketing/record/add', null, data)
};
export const updateCouponMarketingRecord = data => {
    return ADMIN_POST('admin/coupon/marketing/record/update', null, data)
};
export const deleteCouponMarketingRecord = params => {
    return ADMIN_POST('admin/coupon/marketing/record/deleteById', params, null)
};


// ========================短信营销============================
export const getSmsMarketingByPage = data => {
    return ADMIN_POST('admin/sms/marketing/page', null, data)
};
export const addSmsMarketing = data => {
    return ADMIN_POST('admin/sms/marketing/add', null, data)
};
export const updateSmsMarketing = data => {
    return ADMIN_POST('admin/sms/marketing/update', null, data)
};
export const deleteSmsMarketing = params => {
    return ADMIN_POST('admin/sms/marketing/deleteById', params, null)
};
export const getSmsMarketingById = params => {
    return ADMIN_GET('admin/sms/marketing/selectById', params, null)
};


// ======================短信营销记录=========================
export const getSmsMarketingRecordByPage = data => {
    return ADMIN_POST('admin/sms/marketing/record/page', null, data)
};
export const addSmsMarketingRecord = data => {
    return ADMIN_POST('admin/sms/marketing/record/add', null, data)
};
export const updateSmsMarketingRecord = data => {
    return ADMIN_POST('admin/sms/marketing/record/update', null, data)
};
export const deleteSmsMarketingRecord = params => {
    return ADMIN_POST('admin/sms/marketing/record/deleteById', params, null)
};


// ======================点评店铺信息===========================
export const getDpShopByPage = data => {
    return ADMIN_POST('admin/dp/shop/page', null, data)
};
export const getDpShopByPageExt = (params, data) => {
    return ADMIN_POST('admin/dp/shop/page', params, data)
};
export const addDpShop = data => {
    return ADMIN_POST('admin/dp/shop/add', null, data)
};
export const addDpShopManual = data => {
    return ADMIN_POST('admin/dp/shop/add/manual', null, data)
};
export const updateDpShop = data => {
    return ADMIN_POST('admin/dp/shop/update', null, data)
};
export const updateDpShopParam = data => {
    return ADMIN_POST('admin/dp/shop/param', null, data)
};
export const deleteDpShop = params => {
    return ADMIN_POST('admin/dp/shop/deleteById', params, null)
};
export const getDpShopByShopId = params => {
    return ADMIN_GET('admin/dp/shop/selectByShopId', params, null)
};
export const getDpShopByShopUuid = params => {
    return ADMIN_GET('admin/dp/shop/selectByShopUuid', params, null)
};
export const getAllShops = () => {
    return ADMIN_GET('admin/dp/shop/selectAll', null, null)
};
// 刷新门店
export const refreshDpShop = params => {
    return ADMIN_POST('admin/dp/shop/refresh', params, null)
};
// 同步门店点评预定数据
export const syncDpShopReserveData = data => {
    return ADMIN_POST('admin/dp/shop/syncReserve', null, data)
};
// 同步门店点评评价数据
export const syncDpShopFeedbackData = data => {
    return ADMIN_POST('admin/dp/shop/syncFeedback', null, data)
};
// 重新同步门店点评评价数据
export const reSyncDpShopFeedbackData = data => {
    return ADMIN_POST('admin/dp/shop/reSyncFeedback', null, data)
};
// 同步招牌菜数据
export const syncDpShopSpecialDish = data => {
    return ADMIN_POST('admin/dp/shop/syncSpecialDish', null, data)
};
// 获取招牌菜数据
export const getDpSpecialDishByPage = data => {
    return ADMIN_POST('admin/dp/special/dish/page', null, data)
};
// 同步菜单
export const syncDpShopMenu = params => {
    return ADMIN_POST('admin/dp/shop/syncMenu', params, null)
};
// 解析榜单
export const parseDpRankInfo = params => {
    return ADMIN_GET('admin/dp/shop/parseRankInfo', params, null)
};
// 获取多个门店信息
export const getDpShopsByShopId = params => {
    return ADMIN_GET('admin/dp/shop/getShops', params, null)
};
// 获取多个门店同一日期对比信息
export const getDpCompareDataByShop = params => {
    return ADMIN_GET('admin/dp/shop/getCompareDataByShop', params, null)
};
// 获取同一门店不同日期对比信息
export const getDpCompareDataByDate = params => {
    return ADMIN_GET('admin/dp/shop/getCompareDataByDate', params, null)
};
// 同步点评数据
export const syncDpShopData = data => {
    return ADMIN_POST('admin/dp/shop/syncData', null, data)
};
// 获取门店的汇总数据
export const getDpShopDataSummary = params => {
    return ADMIN_GET('admin/dp/shop/getShopSummary', params, null)
};
// 上移排序
export const upDpShopOrder = data => {
    return ADMIN_POST('admin/dp/shop/upOrder', null, data)
};
// 交换顺序
export const changeDpShopOrder = data => {
    return ADMIN_POST('admin/dp/shop/changeOrder', null, data)
};


// ====================点评店铺历史数据========================
export const getDpShopHistoryByPage = data => {
    return ADMIN_POST('admin/dp/shop/history/page', null, data)
};
export const addDpShopHistory = data => {
    return ADMIN_POST('admin/dp/shop/history/add', null, data)
};
export const updateDpShopHistory = data => {
    return ADMIN_POST('admin/dp/shop/history/update', null, data)
};
export const deleteDpShopHistory = params => {
    return ADMIN_POST('admin/dp/shop/history/deleteById', params, null)
};
export const getDownloadDailyReportUrl = () => {
    return getBase(ADMIN_SYSTEM) + "admin/dp/shop/downloadDailyReport";
}
export const getDownloadDailyMultipleReportUrl = () => {
    return getBase(ADMIN_SYSTEM) + "admin/dp/shop/downloadDailyMultipleReport";
}
export const getDownloadWeeklyReportUrl = () => {
    return getBase(ADMIN_SYSTEM) + "admin/dp/shop/downloadWeeklyReport";
}
export const getDownloadMonthlyReportUrl = () => {
    return getBase(ADMIN_SYSTEM) + "admin/dp/shop/downloadMonthlyReport";
}
export const getDownloadStandardReportUrl = () => {
    return getBase(ADMIN_SYSTEM) + "admin/dp/shop/downloadStandardReport";
}
export const clearDpCache = params => {
    return ADMIN_GET('admin/dp/shop/clearCache', params, null)
};


// ======================点评预定数据=========================
export const getDpReserveByPage = data => {
    return ADMIN_POST('admin/dp/reserve/page', null, data)
};
export const addDpReserve = data => {
    return ADMIN_POST('admin/dp/reserve/add', null, data)
};
export const updateDpReserve = data => {
    return ADMIN_POST('admin/dp/reserve/update', null, data)
};
export const deleteDpReserve = params => {
    return ADMIN_POST('admin/dp/reserve/deleteById', params, null)
};
// 同步所有预定记录
export const syncDpReserveAll = params => {
    return ADMIN_POST('admin/dp/reserve/syncAll', params, null)
};
// 同步单条预定记录
export const syncDpReserveSingle = params => {
    return ADMIN_POST('admin/dp/reserve/syncSingle', params, null)
};


// ======================点评评价数据=========================
export const getDpFeedbackByPage = data => {
    return ADMIN_POST('admin/dp/feedback/page', null, data)
};
export const addDpFeedback = data => {
    return ADMIN_POST('admin/dp/feedback/add', null, data)
};
export const updateDpFeedback = data => {
    return ADMIN_POST('admin/dp/feedback/update', null, data)
};
export const deleteDpFeedback = params => {
    return ADMIN_POST('admin/dp/feedback/deleteById', params, null)
};
// 回复评价
export const replyDpFeedback = data => {
    return ADMIN_POST('admin/dp/feedback/reply', null, data)
};
// ChatGPT
export const generateReplyContentByChatGPT = params => {
    return ADMIN_POST('admin/dp/feedback/generateReplyContentByChatGPT', params, null)
};
// 饼图数据
export const getDpFeedbackPieData = params => {
    return ADMIN_GET('admin/dp/feedback/getPieData', params, null)
};
// 柱状图数据
export const getDpFeedbackBarData = params => {
    return ADMIN_GET('admin/dp/feedback/getBarData', params, null)
};
// 饼图+柱状图数据
export const getDpFeedbackChartData = params => {
    return ADMIN_GET('admin/dp/feedback/getChartData', params, null)
};


// ======================点评推广通计划=========================
export const getDpCpcPlanByPage = data => {
    return ADMIN_POST('admin/dp/cpc/plan/page', null, data)
};
export const getDpCpcPlanByShopId = params => {
    return ADMIN_GET('admin/dp/cpc/plan/selectByShopId', params, null)
};
export const getDpCpcPlanById = params => {
    return ADMIN_GET('admin/dp/cpc/plan/selectById', params, null)
};
export const syncDpCpcPlan = params => {
    return ADMIN_GET('admin/dp/cpc/plan/sync', params, null)
};
export const viewDpCpcPlanSystemBid = params => {
    return ADMIN_GET('admin/dp/cpc/plan/viewSystemBid', params, null)
};
export const getDpCpcPlanData = params => {
    return ADMIN_GET('admin/dp/cpc/plan/getPlanData', params, null)
};
export const getDpCpcPlanFields = params => {
    return ADMIN_GET('admin/dp/cpc/plan/fields', params, null)
};
export const setDpCpcPlanPrice = (params, data) => {
    return ADMIN_POST('admin/dp/cpc/plan/setPrice', params, data)
};
export const getDpCpcPlanStrategy = params => {
    return ADMIN_GET('admin/dp/cpc/plan/getStrategy', params, null)
};
export const setDpCpcPlanStrategy = (data) => {
    return ADMIN_POST('admin/dp/cpc/plan/setStrategy', null, data)
};


// ======================点评关键字推广=========================
export const getDpCpcKeywordByPage = data => {
    return ADMIN_POST('admin/dp/cpc/keyword/page', null, data)
};
export const addDpCpcKeyword = data => {
    return ADMIN_POST('admin/dp/cpc/keyword/add', null, data)
};
export const updateDpCpcKeyword = data => {
    return ADMIN_POST('admin/dp/cpc/keyword/update', null, data)
};
export const deleteDpCpcKeyword = params => {
    return ADMIN_POST('admin/dp/cpc/keyword/deleteById', params, null)
};
export const setDpCpcKeywordPrice = (data) => {
    return ADMIN_POST('admin/dp/cpc/keyword/setPrice', null, data)
};
export const syncDpCpcKeyword = params => {
    return ADMIN_GET('admin/dp/cpc/keyword/sync', params, null)
};


// ======================点评推广通报表=========================
export const getDpCpcReportByPage = data => {
    return ADMIN_POST('admin/dp/cpc/report/page', null, data)
};
export const addDpCpcReport = data => {
    return ADMIN_POST('admin/dp/cpc/report/add', null, data)
};
export const updateDpCpcReport = data => {
    return ADMIN_POST('admin/dp/cpc/report/update', null, data)
};
export const deleteDpCpcReport = params => {
    return ADMIN_POST('admin/dp/cpc/report/deleteById', params, null)
};
export const syncDpCpcReport = data => {
    return ADMIN_POST('admin/dp/cpc/report/sync', null, data)
};
export const getDpCpcReportSummaryData = params => {
    return ADMIN_GET('admin/dp/cpc/report/getSummaryData', params, null)
};
export const getDpCpcReportBarData = params => {
    return ADMIN_GET('admin/dp/cpc/report/getBarData', params, null)
};
export const getDpCpcReportCostPieData = params => {
    return ADMIN_GET('admin/dp/cpc/report/getCostPieData', params, null)
};


// ======================点评日常数据=========================
export const getDpDailyDataByPage = data => {
    return ADMIN_POST('admin/dp/daily/data/page', null, data)
};
export const addDpDailyData = data => {
    return ADMIN_POST('admin/dp/daily/data/add', null, data)
};
export const updateDpDailyData = data => {
    return ADMIN_POST('admin/dp/daily/data/update', null, data)
};
export const deleteDpDailyData = params => {
    return ADMIN_POST('admin/dp/daily/data/deleteById', params, null)
};
export const syncDpDailyData = data => {
    return ADMIN_POST('admin/dp/daily/data/sync', null, data)
};
export const getDpDailyBarData = params => {
    return ADMIN_GET('admin/dp/daily/data/getBarData', params, null)
};


// ======================点评浏览量数据=========================
export const getDpPageViewByPage = data => {
    return ADMIN_POST('admin/dp/page/view/page', null, data)
};
export const addDpPageView = data => {
    return ADMIN_POST('admin/dp/page/view/add', null, data)
};
export const updateDpPageView = data => {
    return ADMIN_POST('admin/dp/page/view/update', null, data)
};
export const deleteDpPageView = params => {
    return ADMIN_POST('admin/dp/page/view/deleteById', params, null)
};
export const syncDpPageView = data => {
    return ADMIN_POST('admin/dp/page/view/sync', null, data)
};


// ======================点评收入数据=========================
export const getDpRevenueByPage = data => {
    return ADMIN_POST('admin/dp/revenue/page', null, data)
};
export const addDpRevenue = data => {
    return ADMIN_POST('admin/dp/revenue/add', null, data)
};
export const updateDpRevenue = data => {
    return ADMIN_POST('admin/dp/revenue/update', null, data)
};
export const deleteDpRevenue = params => {
    return ADMIN_POST('admin/dp/revenue/deleteById', params, null)
};
export const syncDpRevenue = data => {
    return ADMIN_POST('admin/dp/revenue/sync', null, data)
};


// ======================点评入口图=========================
export const getDpEntryPicByPage = data => {
    return ADMIN_POST('admin/dp/entry/pic/page', null, data)
};
export const addDpEntryPic = data => {
    return ADMIN_POST('admin/dp/entry/pic/add', null, data)
};
export const updateDpEntryPic = data => {
    return ADMIN_POST('admin/dp/entry/pic/update', null, data)
};
export const deleteDpEntryPic = params => {
    return ADMIN_POST('admin/dp/entry/pic/deleteById', params, null)
};
export const getDpEntryPic = params => {
    return ADMIN_GET('admin/dp/shop/entry/pic', params, null)
};


// ======================点评入口图历史=========================
export const getDpEntryPicHistoryByPage = data => {
    return ADMIN_POST('admin/dp/entry/pic/history/page', null, data)
};
export const addDpEntryPicHistory = data => {
    return ADMIN_POST('admin/dp/entry/pic/history/add', null, data)
};
export const updateDpEntryPicHistory = data => {
    return ADMIN_POST('admin/dp/entry/pic/history/update', null, data)
};
export const deleteDpEntryPicHistory = params => {
    return ADMIN_POST('admin/dp/entry/pic/history/deleteById', params, null)
};
export const getDpEntryPicHistory = params => {
    return ADMIN_GET('admin/dp/shop/entry/pic/history', params, null)
};


// ======================点评评价回复模版========================
export const getDpFeedbackReplyTemplateByPage = data => {
    return ADMIN_POST('admin/dp/feedback/reply/template/page', null, data)
};
export const addDpFeedbackReplyTemplate = data => {
    return ADMIN_POST('admin/dp/feedback/reply/template/add', null, data)
};
export const updateDpFeedbackReplyTemplate = data => {
    return ADMIN_POST('admin/dp/feedback/reply/template/update', null, data)
};
export const deleteDpFeedbackReplyTemplate = params => {
    return ADMIN_POST('admin/dp/feedback/reply/template/deleteById', params, null)
};
export const getDpFeedbackReplyTemplatesByShopId = params => {
    return ADMIN_GET('admin/dp/feedback/reply/template/selectByShopId', params, null)
};


// =====================点评推广通余额=======================
export const getDpCpcBalanceByPage = data => {
    return ADMIN_POST('admin/dp/cpc/balance/page', null, data)
};
export const addDpCpcBalance = data => {
    return ADMIN_POST('admin/dp/cpc/balance/add', null, data)
};
export const updateDpCpcBalance = data => {
    return ADMIN_POST('admin/dp/cpc/balance/update', null, data)
};
export const deleteDpCpcBalance = params => {
    return ADMIN_POST('admin/dp/cpc/balance/deleteById', params, null)
};
export const syncDpCpcBalance = params => {
    return ADMIN_GET('admin/dp/cpc/balance/sync', params, null)
};


// ======================点评推送配置========================
export const getDpPushConfigByPage = data => {
    return ADMIN_POST('admin/dp/push/config/page', null, data)
};
export const addDpPushConfig = data => {
    return ADMIN_POST('admin/dp/push/config/add', null, data)
};
export const updateDpPushConfig = data => {
    return ADMIN_POST('admin/dp/push/config/update', null, data)
};
export const deleteDpPushConfig = params => {
    return ADMIN_POST('admin/dp/push/config/deleteById', params, null)
};


// ======================点评CPC数据=========================
export const getDpCpcBidByPage = data => {
    return ADMIN_POST('admin/dp/cpc/bid/page', null, data)
};
export const addDpCpcBid = data => {
    return ADMIN_POST('admin/dp/cpc/bid/add', null, data)
};
export const updateDpCpcBid = data => {
    return ADMIN_POST('admin/dp/cpc/bid/update', null, data)
};
export const deleteDpCpcBid = params => {
    return ADMIN_POST('admin/dp/cpc/bid/deleteById', params, null)
};
// 查看CPC竞价信息
export const viewCpcNow = params => {
    return ADMIN_GET('admin/dp/cpc/bid/now', params, null)
};


// =====================点评CPC日志==========================
export const getDpCpcLogByPage = data => {
    return ADMIN_POST('admin/dp/cpc/log/page', null, data)
};
export const addDpCpcLog = data => {
    return ADMIN_POST('admin/dp/cpc/log/add', null, data)
};
export const updateDpCpcLog = data => {
    return ADMIN_POST('admin/dp/cpc/log/update', null, data)
};
export const deleteDpCpcLog = params => {
    return ADMIN_POST('admin/dp/cpc/log/deleteById', params, null)
};


// =====================点评榜单==========================
export const getDpRankByPage = data => {
    return ADMIN_POST('admin/dp/rank/page', null, data)
};
export const addDpRank = data => {
    return ADMIN_POST('admin/dp/rank/add', null, data)
};
export const updateDpRank = data => {
    return ADMIN_POST('admin/dp/rank/update', null, data)
};
export const deleteDpRank = params => {
    return ADMIN_POST('admin/dp/rank/deleteById', params, null)
};
export const getDpRankById = params => {
    return ADMIN_GET('admin/dp/rank/selectById', params, null)
};
export const getDpRankByRankKey = params => {
    return ADMIN_GET('admin/dp/rank/selectByRankKey', params, null)
};
export const syncDpRank = params => {
    return ADMIN_POST('admin/dp/rank/sync', params, null)
};


// =====================点评榜单门店==========================
export const getDpRankShopByPage = data => {
    return ADMIN_POST('admin/dp/rank/shop/page', null, data)
};
export const addDpRankShop = data => {
    return ADMIN_POST('admin/dp/rank/shop/add', null, data)
};
export const updateDpRankShop = data => {
    return ADMIN_POST('admin/dp/rank/shop/update', null, data)
};
export const deleteDpRankShop = params => {
    return ADMIN_POST('admin/dp/rank/shop/deleteById', params, null)
};
export const selectDpRankShopByQ = params => {
    return ADMIN_GET('admin/dp/rank/shop/selectByQ', params, null)
};


// =====================点评团购==========================
export const getDpTuanByPage = data => {
    return ADMIN_POST('admin/dp/tuan/page', null, data)
};
export const addDpTuan = data => {
    return ADMIN_POST('admin/dp/tuan/add', null, data)
};
export const updateDpTuan = data => {
    return ADMIN_POST('admin/dp/tuan/update', null, data)
};
export const deleteDpTuan = params => {
    return ADMIN_POST('admin/dp/tuan/deleteById', params, null)
};


// ====================点评团购历史数据========================
export const getDpTuanHistoryByPage = data => {
    return ADMIN_POST('admin/dp/tuan/history/page', null, data)
};
export const addDpTuanHistory = data => {
    return ADMIN_POST('admin/dp/tuan/history/add', null, data)
};
export const updateDpTuanHistory = data => {
    return ADMIN_POST('admin/dp/tuan/history/update', null, data)
};
export const deleteDpTuanHistory = params => {
    return ADMIN_POST('admin/dp/tuan/history/deleteById', params, null)
};


// ====================点评消费汇总数据========================
export const getDpConsumeSummaryByPage = data => {
    return ADMIN_POST('admin/dp/consume/summary/page', null, data)
};
export const addDpConsumeSummary = data => {
    return ADMIN_POST('admin/dp/consume/summary/add', null, data)
};
export const updateDpConsumeSummary = data => {
    return ADMIN_POST('admin/dp/consume/summary/update', null, data)
};
export const deleteDpConsumeSummary = params => {
    return ADMIN_POST('admin/dp/consume/summary/deleteById', params, null)
};
export const syncDpConsumeSummary = data => {
    return ADMIN_POST('admin/dp/consume/summary/sync', null, data)
};
// 饼图+柱状图数据
export const getDpConsumeSummaryChartData = params => {
    return ADMIN_GET('admin/dp/consume/summary/getChartData', params, null)
};


// ====================点评消费详情数据========================
export const getDpConsumeDetailByPage = data => {
    return ADMIN_POST('admin/dp/consume/detail/page', null, data)
};
export const addDpConsumeDetail = data => {
    return ADMIN_POST('admin/dp/consume/detail/add', null, data)
};
export const updateDpConsumeDetail = data => {
    return ADMIN_POST('admin/dp/consume/detail/update', null, data)
};
export const deleteDpConsumeDetail = params => {
    return ADMIN_POST('admin/dp/consume/detail/deleteById', params, null)
};


// =====================企业微信配置==========================
export const getWorkAppConfigByPage = data => {
    return ADMIN_POST('admin/workAppConfig/page', null, data)
};
export const addWorkAppConfig = data => {
    return ADMIN_POST('admin/workAppConfig/add', null, data)
};
export const updateWorkAppConfig = data => {
    return ADMIN_POST('admin/workAppConfig/update', null, data)
};
export const deleteWorkAppConfig = params => {
    return ADMIN_POST('admin/workAppConfig/deleteById', params, null)
};
export const refreshWorkAppConfig = params => {
    return ADMIN_POST('admin/workAppConfig/refresh', params, null)
};


// =====================开放平台第三方应用配置=====================
export const getOpenThirdConfigByPage = data => {
    return ADMIN_POST('admin/openThirdConfig/page', null, data)
};
export const addOpenThirdConfig = data => {
    return ADMIN_POST('admin/openThirdConfig/add', null, data)
};
export const updateOpenThirdConfig = data => {
    return ADMIN_POST('admin/openThirdConfig/update', null, data)
};
export const deleteOpenThirdConfig = params => {
    return ADMIN_POST('admin/openThirdConfig/deleteById', params, null)
};
export const refreshOpenThirdConfig = params => {
    return ADMIN_POST('admin/openThirdConfig/refresh', params, null)
};
export const getOpenThirdById = params => {
    return ADMIN_GET('admin/openThirdConfig/selectById', params, null)
};
export const getTemplatedRaftList = params => {
    return ADMIN_GET('admin/openThirdConfig/getTemplatedRaftList', params, null)
};
export const getTemplateList = params => {
    return ADMIN_GET('admin/openThirdConfig/getTemplateList', params, null)
};
// 添加到模版库
export const addToTemplate = params => {
    return ADMIN_POST('admin/openThirdConfig/addToTemplate', params, null)
};
// 删除模版
export const deleteTemplate = params => {
    return ADMIN_POST('admin/openThirdConfig/deleteTemplate', params, null)
};


// =====================企业微信客户管理=====================
export const getWorkCustomerByPage = data => {
    return ADMIN_POST('admin/workCustomer/page', null, data)
};
export const addWorkCustomer = data => {
    return ADMIN_POST('admin/workCustomer/add', null, data)
};
export const updateWorkCustomer = data => {
    return ADMIN_POST('admin/workCustomer/update', null, data)
};
export const deleteWorkCustomer = params => {
    return ADMIN_POST('admin/workCustomer/deleteById', params, null)
};
export const refreshWorkCustomer = params => {
    return ADMIN_POST('admin/workCustomer/refresh', params, null)
};
export const syncWorkCustomer = params => {
    return ADMIN_POST('admin/workCustomer/sync', params, null)
};
export const getWorkCustomerProfileByExternalUserid = params => {
    return ADMIN_GET('admin/workCustomerProfile/selectByExternalUserid', params, null)
};
export const updateWorkCustomerProfile = data => {
    return ADMIN_POST('admin/workCustomerProfile/update', null, data)
};


// =====================企业微信标签管理=====================
export const getWorkTagGroupByPage = data => {
    return ADMIN_POST('admin/workTagGroup/page', null, data)
};
export const addWorkTagGroup = data => {
    return ADMIN_POST('admin/workTagGroup/add', null, data)
};
export const updateWorkTagGroup = data => {
    return ADMIN_POST('admin/workTagGroup/update', null, data)
};
export const deleteWorkTagGroup = params => {
    return ADMIN_POST('admin/workTagGroup/deleteById', params, null)
};
export const refreshWorkTagGroup = params => {
    return ADMIN_POST('admin/workTagGroup/refresh', params, null)
};
export const syncWorkTagGroup = params => {
    return ADMIN_POST('admin/workTagGroup/sync', params, null)
};
export const delWorkTag = data => {
    return ADMIN_POST('admin/workTag/delete', null, data)
};


// =====================企业微信公司信息=====================
export const getWorkCorpByPage = data => {
    return ADMIN_POST('admin/workCorp/page', null, data)
};
export const addWorkCorp = data => {
    return ADMIN_POST('admin/workCorp/add', null, data)
};
export const addWorkCorpByAuth = params => {
    return ADMIN_GET('wx/work/getWebAuthUrlEx', params, null)
};
export const updateWorkCorp = data => {
    return ADMIN_POST('admin/workCorp/update', null, data)
};
export const deleteWorkCorp = params => {
    return ADMIN_POST('admin/workCorp/deleteById', params, null)
};
export const refreshWorkCorp = params => {
    return ADMIN_POST('admin/workCorp/refresh', params, null)
};
export const getWorkCorpById = params => {
    return ADMIN_GET('admin/workCorp/selectById', params, null)
};
export const fillWorkCorp = data => {
    return ADMIN_POST('admin/workCorp/fill', null, data)
};
export const getCustomAppAuthQrcode = params => {
    return ADMIN_GET('admin/workCorp/getCustomAppAuthQrcode', params, null)
};
export const getWorkCorpProfileUrl = params => {
    return ADMIN_GET('admin/workCorp/getProfileUrl', params, null)
};
export const getWorkCorpMaterialUrl = params => {
    return ADMIN_GET('admin/workCorp/getMaterialUrl', params, null)
};
export const linkMerchant = data => {
    return ADMIN_POST('admin/workCorp/linkMerchant', null, data)
};


// =====================企业微信第三方应用信息=====================
export const getWorkCorpThirdAppByPage = data => {
    return ADMIN_POST('admin/workCorpThirdApp/page', null, data)
};
export const addWorkCorpThirdApp = data => {
    return ADMIN_POST('admin/workCorpThirdApp/add', null, data)
};
export const updateWorkCorpThirdApp = data => {
    return ADMIN_POST('admin/workCorpThirdApp/update', null, data)
};
export const deleteWorkCorpThirdApp = params => {
    return ADMIN_POST('admin/workCorpThirdApp/deleteById', params, null)
};
export const refreshWorkCorpThirdApp = params => {
    return ADMIN_POST('admin/workCorpThirdApp/refresh', params, null)
};


// =====================企业微信自身应用信息=====================
export const getWorkCorpSelfAppByPage = data => {
    return ADMIN_POST('admin/workCorpSelfApp/page', null, data)
};
export const addWorkCorpSelfApp = data => {
    return ADMIN_POST('admin/workCorpSelfApp/add', null, data)
};
export const updateWorkCorpSelfApp = data => {
    return ADMIN_POST('admin/workCorpSelfApp/update', null, data)
};
export const deleteWorkCorpSelfApp = params => {
    return ADMIN_POST('admin/workCorpSelfApp/deleteById', params, null)
};
export const configWorkCorpSelfContact = data => {
    return ADMIN_POST('admin/workCorpSelfApp/config/contact', null, data)
};
export const configWorkCorpSelfCustomer = data => {
    return ADMIN_POST('admin/workCorpSelfApp/config/customer', null, data)
};
export const refreshWorkCorpSelfApp = params => {
    return ADMIN_POST('admin/workCorpSelfApp/refresh', params, null)
};


// =====================企业微信员工信息=====================
export const getWorkEmployeeByPage = data => {
    return ADMIN_POST('admin/workEmployee/page', null, data)
};
export const addWorkEmployee = data => {
    return ADMIN_POST('admin/workEmployee/add', null, data)
};
export const updateWorkEmployee = data => {
    return ADMIN_POST('admin/workEmployee/update', null, data)
};
export const deleteWorkEmployee = params => {
    return ADMIN_POST('admin/workEmployee/deleteById', params, null)
};
export const syncWorkEmployee = params => {
    return ADMIN_POST('admin/workEmployee/sync', params, null)
};
export const refreshWorkEmployee = params => {
    return ADMIN_POST('admin/workEmployee/refresh', params, null)
};
export const sendMessageToEmployee = data => {
    return ADMIN_POST('admin/workEmployee/sendMessage', null, data)
};
// 欢迎语配置
export const configWelcomeMsgWorkEmployee = data => {
    return ADMIN_POST('admin/workEmployee/configWelcomeMsg', null, data)
};


// =====================企业微信部门信息=====================
export const getWorkDepartmentByPage = data => {
    return ADMIN_POST('admin/workDepartment/page', null, data)
};
export const addWorkDepartment = data => {
    return ADMIN_POST('admin/workDepartment/add', null, data)
};
export const updateWorkDepartment = data => {
    return ADMIN_POST('admin/workDepartment/update', null, data)
};
export const deleteWorkDepartment = params => {
    return ADMIN_POST('admin/workDepartment/deleteById', params, null)
};
export const syncWorkDepartment = params => {
    return ADMIN_POST('admin/workDepartment/sync', params, null)
};
export const refreshWorkDepartment = params => {
    return ADMIN_POST('admin/workDepartment/refresh', params, null)
};


// =====================企业微信群聊信息=====================
export const getWorkGroupChatByPage = data => {
    return ADMIN_POST('admin/workGroupChat/page', null, data)
};
export const getGroupChatById = params => {
    return ADMIN_GET('admin/workGroupChat/selectById', params, null)
};
export const addWorkGroupChat = data => {
    return ADMIN_POST('admin/workGroupChat/add', null, data)
};
export const updateWorkGroupChat = data => {
    return ADMIN_POST('admin/workGroupChat/update', null, data)
};
export const deleteWorkGroupChat = params => {
    return ADMIN_POST('admin/workGroupChat/deleteById', params, null)
};
export const syncWorkGroupChat = params => {
    return ADMIN_POST('admin/workGroupChat/sync', params, null)
};
export const refreshWorkGroupChat = params => {
    return ADMIN_POST('admin/workGroupChat/refresh', params, null)
};


// =====================企业微信群聊成员信息=====================
export const getWorkGroupChatMemberByPage = data => {
    return ADMIN_POST('admin/workGroupChatMember/page', null, data)
};
export const addWorkGroupChatMember = data => {
    return ADMIN_POST('admin/workGroupChatMember/add', null, data)
};
export const updateWorkGroupChatMember = data => {
    return ADMIN_POST('admin/workGroupChatMember/update', null, data)
};
export const deleteWorkGroupChatMember = params => {
    return ADMIN_POST('admin/workGroupChatMember/deleteById', params, null)
};


// =====================企业微信素材管理=====================
export const getWorkMaterialByPage = data => {
    return ADMIN_POST('admin/workMaterial/page', null, data)
};
export const addWorkMaterial = data => {
    return ADMIN_POST('admin/workMaterial/add', null, data)
};
export const updateWorkMaterial = data => {
    return ADMIN_POST('admin/workMaterial/update', null, data)
};
export const deleteWorkMaterial = params => {
    return ADMIN_POST('admin/workMaterial/deleteById', params, null)
};
export const refreshWorkMaterial = params => {
    return ADMIN_POST('admin/workMaterial/refresh', params, null)
};


// =====================企业微信欢迎语管理=====================
export const getWorkWelcomeMsgByPage = data => {
    return ADMIN_POST('admin/workWelcomeMsg/page', null, data)
};
export const addWorkWelcomeMsg = data => {
    return ADMIN_POST('admin/workWelcomeMsg/add', null, data)
};
export const updateWorkWelcomeMsg = data => {
    return ADMIN_POST('admin/workWelcomeMsg/update', null, data)
};
export const deleteWorkWelcomeMsg = params => {
    return ADMIN_POST('admin/workWelcomeMsg/deleteById', params, null)
};
export const getWorkWelcomeMsgById = params => {
    return ADMIN_GET('admin/workWelcomeMsg/selectById', params, null)
};


// =====================企业微信员工活码=====================
export const getWorkQrcodeEmployeeByPage = data => {
    return ADMIN_POST('admin/workQrcodeEmployee/page', null, data)
};
export const addWorkQrcodeEmployee = data => {
    return ADMIN_POST('admin/workQrcodeEmployee/add', null, data)
};
export const updateWorkQrcodeEmployee = data => {
    return ADMIN_POST('admin/workQrcodeEmployee/update', null, data)
};
export const deleteWorkQrcodeEmployee = params => {
    return ADMIN_POST('admin/workQrcodeEmployee/deleteById', params, null)
};
export const configWelcomeMsgWorkQrcodeEmployee = data => {
    return ADMIN_POST('admin/workQrcodeEmployee/configWelcomeMsg', null, data)
};


// =====================企业微信群活码=====================
export const getWorkQrcodeGroupChatByPage = data => {
    return ADMIN_POST('admin/workQrcodeGroupChat/page', null, data)
};
export const addWorkQrcodeGroupChat = data => {
    return ADMIN_POST('admin/workQrcodeGroupChat/add', null, data)
};
export const updateWorkQrcodeGroupChat = data => {
    return ADMIN_POST('admin/workQrcodeGroupChat/update', null, data)
};
export const deleteWorkQrcodeGroupChat = params => {
    return ADMIN_POST('admin/workQrcodeGroupChat/deleteById', params, null)
};


// =====================企业微信门店活码=====================
export const getWorkQrcodeShopByPage = data => {
    return ADMIN_POST('admin/workQrcodeShop/page', null, data)
};
export const addWorkQrcodeShop = data => {
    return ADMIN_POST('admin/workQrcodeShop/add', null, data)
};
export const updateWorkQrcodeShop = data => {
    return ADMIN_POST('admin/workQrcodeShop/update', null, data)
};
export const deleteWorkQrcodeShop = params => {
    return ADMIN_POST('admin/workQrcodeShop/deleteById', params, null)
};


// =====================企业微信组合码=====================
export const getWorkQrcodeGroupByPage = data => {
    return ADMIN_POST('admin/workQrcodeGroup/page', null, data)
};
export const addWorkQrcodeGroup = data => {
    return ADMIN_POST('admin/workQrcodeGroup/add', null, data)
};
export const updateWorkQrcodeGroup = data => {
    return ADMIN_POST('admin/workQrcodeGroup/update', null, data)
};
export const deleteWorkQrcodeGroup = params => {
    return ADMIN_POST('admin/workQrcodeGroup/deleteById', params, null)
};
export const getWorkQrcodeGroupById = params => {
    return ADMIN_GET('admin/workQrcodeGroup/selectById', params, null)
};


// =====================相册管理=====================
export const getAlbumByPage = data => {
    return ADMIN_POST('admin/album/page', null, data)
};
export const addAlbum = data => {
    return ADMIN_POST('admin/album/add', null, data)
};
export const updateAlbum = data => {
    return ADMIN_POST('admin/album/update', null, data)
};
export const deleteAlbum = params => {
    return ADMIN_POST('admin/album/deleteById', params, null)
};


// =====================小程序协议管理=====================
export const getMnpAgreementByPage = data => {
    return ADMIN_POST('admin/mnp/agreement/page', null, data)
};
export const addMnpAgreement = data => {
    return ADMIN_POST('admin/mnp/agreement/add', null, data)
};
export const updateMnpAgreement = data => {
    return ADMIN_POST('admin/mnp/agreement/update', null, data)
};
export const deleteMnpAgreement = params => {
    return ADMIN_POST('admin/mnp/agreement/deleteById', params, null)
};


// ==================-小程序广告配置===================
export const getMnpConfigByPage = data => {
    return ADMIN_POST('admin/mnp/config/page', null, data)
};
export const addMnpConfig = data => {
    return ADMIN_POST('admin/mnp/config/add', null, data)
};
export const updateMnpConfig = data => {
    return ADMIN_POST('admin/mnp/config/update', null, data)
};
export const deleteMnpConfig = params => {
    return ADMIN_POST('admin/mnp/config/deleteById', params, null)
};
export const getMnpConfigById = params => {
    return ADMIN_GET('admin/mnp/config/selectById', params, null)
};
export const switchMnpConfigStatus = params => {
    return ADMIN_GET('admin/mnp/config/switchStatus', params, null)
};


// ==================-小程序链接配置===================
export const getMnpLinkByPage = data => {
    return ADMIN_POST('admin/mnp/link/page', null, data)
};
export const addMnpLink = data => {
    return ADMIN_POST('admin/mnp/link/add', null, data)
};
export const updateMnpLink = data => {
    return ADMIN_POST('admin/mnp/link/update', null, data)
};
export const deleteMnpLink = params => {
    return ADMIN_POST('admin/mnp/link/deleteById', params, null)
};


// ==================-小程序菜单配置===================
export const getMnpMenuByPage = data => {
    return ADMIN_POST('admin/mnp/menu/page', null, data)
};
export const addMnpMenu = data => {
    return ADMIN_POST('admin/mnp/menu/add', null, data)
};
export const updateMnpMenu = data => {
    return ADMIN_POST('admin/mnp/menu/update', null, data)
};
export const deleteMnpMenu = params => {
    return ADMIN_POST('admin/mnp/menu/deleteById', params, null)
};
export const configMnpSystemMenu = params => {
    return ADMIN_POST('admin/mnp/menu/configSystemMenu', params, null)
};


// ==================-小程序二维码配置===================
export const getMnpQrcodeByPage = data => {
    return ADMIN_POST('admin/mnp/qrcode/page', null, data)
};
export const addMnpQrcode = data => {
    return ADMIN_POST('admin/mnp/qrcode/add', null, data)
};
export const updateMnpQrcode = data => {
    return ADMIN_POST('admin/mnp/qrcode/update', null, data)
};
export const deleteMnpQrcode = params => {
    return ADMIN_POST('admin/mnp/qrcode/deleteById', params, null)
};


// =====================短信=====================
export const getSmsByPage = data => {
    return ADMIN_POST('admin/sms/page', null, data)
};
export const addSms = data => {
    return ADMIN_POST('admin/sms/add', null, data)
};
export const updateSms = data => {
    return ADMIN_POST('admin/sms/update', null, data)
};
export const deleteSms = params => {
    return ADMIN_POST('admin/sms/deleteById', params, null)
};


// ==================短信内容配置===================
export const getSmsTemplateConfigByPage = data => {
    return ADMIN_POST('admin/smsTemplateConfig/page', null, data)
};
export const addSmsTemplateConfig = data => {
    return ADMIN_POST('admin/smsTemplateConfig/add', null, data)
};
export const updateSmsTemplateConfig = data => {
    return ADMIN_POST('admin/smsTemplateConfig/update', null, data)
};
export const deleteSmsTemplateConfig = params => {
    return ADMIN_POST('admin/smsTemplateConfig/deleteById', params, null)
};
export const selectSmsMarketingTemplates = params => {
    return ADMIN_GET('admin/smsTemplateConfig/selectMarketingTemplates', params, null)
};


// ==================短信签名配置===================
export const getSmsSignConfigByPage = data => {
    return ADMIN_POST('admin/smsSignConfig/page', null, data)
};
export const addSmsSignConfig = data => {
    return ADMIN_POST('admin/smsSignConfig/add', null, data)
};
export const updateSmsSignConfig = data => {
    return ADMIN_POST('admin/smsSignConfig/update', null, data)
};
export const deleteSmsSignConfig = params => {
    return ADMIN_POST('admin/smsSignConfig/deleteById', params, null)
};


// ==================代办事项显示===================
export const getBacklogByPage = data => {
    return ADMIN_POST('admin/backlog/page', null, data)
};
export const addBacklog = data => {
    return ADMIN_POST('admin/backlog/add', null, data)
};
export const updateBacklog = data => {
    return ADMIN_POST('admin/backlog/update', null, data)
};
export const deleteBacklog = params => {
    return ADMIN_POST('admin/backlog/deleteById', params, null)
};


// ==================KOL管理===================
export const getKolByPage = data => {
    return ADMIN_POST('k/kol/page', null, data)
};
export const addKol = data => {
    return ADMIN_POST('k/kol/add', null, data)
};
export const updateKol = data => {
    return ADMIN_POST('k/kol/update', null, data)
};
export const deleteKol = params => {
    return ADMIN_POST('k/kol/deleteById', params, null)
};
export const addKolFromDp = data => {
    return ADMIN_POST('k/kol/addDpKol', null, data)
};
export const getKolById = params => {
    return ADMIN_GET('k/kol/selectById', params, null)
};
export const refreshKol = data => {
    return ADMIN_POST('k/kol/refresh', null, data)
};


// ==================任务管理===================
export const getTaskByPage = data => {
    return ADMIN_POST('k/task/page', null, data)
};
export const addTask = data => {
    return ADMIN_POST('k/task/add', null, data)
};
export const updateTask = data => {
    return ADMIN_POST('k/task/update', null, data)
};
export const deleteTask = params => {
    return ADMIN_POST('k/task/deleteById', params, null)
};
export const getTaskById = params => {
    return ADMIN_GET('k/task/selectById', params, null)
};
export const TaskApply = data => {
    return ADMIN_POST('k/task/apply', null, data)
};
export const TaskApplySubmitJob = data => {
    return ADMIN_POST('k/task/apply/submitJob', null, data)
};
export const taskApplyAudit = data => {
    return ADMIN_POST('k/task/apply/audit', null, data)
};
export const taskApplyChangeKol = data => {
    return ADMIN_POST('k/task/apply/changeKol', null, data)
};
export const taskApplySetTime = data => {
    return ADMIN_POST('k/task/apply/setTime', null, data)
};


// ==================KOL任务管理=================
export const getKolTaskByPage = data => {
    return ADMIN_POST('k/kol/task/page', null, data)
};
export const addKolTask = data => {
    return ADMIN_POST('k/kol/task/add', null, data)
};
export const updateKolTask = data => {
    return ADMIN_POST('k/kol/task/update', null, data)
};
export const deleteKolTask = params => {
    return ADMIN_POST('k/kol/task/deleteById', params, null)
};


// ==================KOL品牌库=================
export const getKolBrandByPage = data => {
    return ADMIN_POST('k/kol/brand/page', null, data)
};
export const addKolBrand = data => {
    return ADMIN_POST('k/kol/brand/add', null, data)
};
export const updateKolBrand = data => {
    return ADMIN_POST('k/kol/brand/update', null, data)
};
export const deleteKolBrand = params => {
    return ADMIN_POST('k/kol/brand/deleteById', params, null)
};


// ==================美食相册===================
export const getGalleryByPage = data => {
    return ADMIN_POST('gallery/page', null, data)
};
export const addGallery = data => {
    return ADMIN_POST('gallery/add', null, data)
};
export const updateGallery = data => {
    return ADMIN_POST('gallery/update', null, data)
};
export const deleteGallery = params => {
    return ADMIN_POST('gallery/deleteById', params, null)
};
export const addGalleryFromDp = data => {
    return ADMIN_POST('gallery/addFromDp', null, data)
};
export const addFromDp5pic = data => {
    return ADMIN_POST('gallery/addFromDp5pic', null, data)
};
export const getGallery5PicByPage = data => {
    return ADMIN_POST('gallery/page5Pic', null, data)
};
export const delete5PicById = params => {
    return ADMIN_POST('gallery/delete5PicById', params, null)
};
export const update5Pic = data => {
    return ADMIN_POST('gallery/update5Pic', null, data)
};
export const addFromDpMenu = data => {
    return ADMIN_POST('gallery/addFromDpMenu', null, data)
};
export const getGalleryMenuPicByPage = data => {
    return ADMIN_POST('gallery/pageMenuPic', null, data)
};
export const deleteMenuPicById = params => {
    return ADMIN_POST('gallery/deleteMenuPicById', params, null)
};
export const updateMenuPic = data => {
    return ADMIN_POST('gallery/updateMenuPic', null, data)
};


// =====================方法封装=================================
export const ADMIN_GET = (url, params) => {
    return axios.get(getBase(ADMIN_SYSTEM) + url, {params: params}).then(res => res.data);
};

export const ADMIN_POST = (url, params, data, download) => {
    return axios.post(getBase(ADMIN_SYSTEM) + url, data, {params: params}).then(res => res.data);
};
// ============================================================


// 获取基础的URL
function getBase(system) {
    let env = window.localStorage.getItem("env");
    if (env == "dev") {
        if (system == ADMIN_SYSTEM) {
            return BASE_ADMIN_DEV;
        }
    } else if (env == "test") {
        if (system == ADMIN_SYSTEM) {
            return BASE_ADMIN_TEST;
        }
    } else {
        if (system == ADMIN_SYSTEM) {
            return BASE_ADMIN_PRO;
        }
    }
}

// response响应拦截
axios.interceptors.response.use(function (response) {
    // 请求结束，蓝色过渡滚动条消失
    NProgress.done();
    let code = response.data.respCode;
    // code == null说明是文件下载
    if (code == 0 || code == null || code == 1 || code == 1000) {
        // 请求成功
        return response;
    } else {
        if (code == 1002) {
            // 1002异常，代表登录过期，需要重新登录
            let fullPath = router.currentRoute.fullPath;
            if (fullPath.indexOf("login") > -1) {
                // 当前已经是登录页面，什么都不做
            } else {
                Message.error('异常码：' + code + '，异常信息：' + response.data.respMsg);
                // 异常登录，回到登录页面
                router.replace({
                    path: '/login',
                    query: {redirect: router.currentRoute.fullPath}
                })
            }
        } else {
            // 其它类型异常
            Message.error('异常码：' + code + '，异常信息：' + response.data.respMsg);
        }
        return response;
    }
}, function (err) {
    // 请求结束，蓝色过渡滚动条消失
    // 即使出现异常，也要调用关闭方法，否则一直处于加载状态很奇怪
    NProgress.done();
    if (err && err.response) {
        switch (err.response.status) {
            case 400:
                err.message = '请求错误(400)';
                break;
            case 401:
                err.message = '未授权，请重新登录(401)';
                break;
            case 403:
                err.message = '拒绝访问(403)';
                break;
            case 404:
                err.message = '请求出错(404)';
                break;
            case 408:
                err.message = '请求超时(408)';
                break;
            case 500:
                err.message = '服务器错误(500)';
                break;
            case 501:
                err.message = '服务未实现(501)';
                break;
            case 502:
                err.message = '网络错误(502)';
                break;
            case 503:
                err.message = '服务不可用(503)';
                break;
            case 504:
                err.message = '网络超时(504)';
                break;
            case 505:
                err.message = 'HTTP版本不受支持(505)';
                break;
            default:
                err.message = `连接出错(${err.response.status})!`;
        }
    } else {
        err.message = '连接服务器失败!';
    }
    Message.error(err.message);
    return Promise.reject(err);
});


// request请求拦截
axios.interceptors.request.use(config => {
    // 请求开始，蓝色过渡滚动条开始出现
    NProgress.start();
    // 设置token
    config.headers.token = getToken();
    // 不使用下面这种写法的原因是本地存储中更新完token后，下一次请求还是会带上上次老的token，再下一次才会带上新的，具体原因待查
    // axios.defaults.headers.common['token'] = getToken();
    return config;
}, err => {
    Message.error('请求超时!');
    return Promise.resolve(err);
});

function getToken() {
    return db.getUser().token;
}
